package com.yhq.basic.design.singleton;

import java.io.Serializable;

/**
 * 单例模式
 * 饿汉式二-静态代码块
 *
 * @author hqyin
 * @date 2023/2/3 10:12 上午
 */
public class Singleton2 implements Serializable {
    private static final Singleton2 INSTANCE;

    private Singleton2() {

    }

    static {
        INSTANCE = new Singleton2();
    }

    public static Singleton2 getInstance() {
        return INSTANCE;
    }
}
